
public class Similarity implements Comparable{
	private Entity firstString, secondString;
	private double similarity, recall, precision;
	private boolean match;
	
	public Similarity(Entity ent1, Entity ent2, double similarity){
		this.firstString = ent1;
		this.secondString = ent2;
		this.similarity = similarity;
		this.match = ent1.getIdentifier().equals(ent2.getIdentifier());
	}
	
	public int compareTo(Object sim) {
		if(this.similarity == ((Similarity)sim).similarity)
			return 0;
		else if(this.similarity > ((Similarity)sim).similarity)
			return -1;
		else
			return 1;
	}
	
	public Entity getFirstEnt(){
		return firstString;
	}
	
	public Entity getSecondEnt(){
		return secondString;
	}
	
	public double getSimilarity(){
		return similarity;
	}
	
	public boolean getMatch(){
		return match;
	}
	
	public void setRecall(double recall){
		this.recall = recall;
	}
	
	public double getRecall(){
		return recall;
	}
	
	public void setPrecision(double precision){
		this.precision = precision;
	}
	
	public double getPrecision(){
		return precision;
	}

	public String toString(){
		return firstString + " - " + secondString + " - " + similarity;
	}
}
